package com.yehuishou.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yehuishou.dao.BackItemDao;
import com.yehuishou.pojo.BackItem;
import com.yehuishou.service.BackItemService;


@Service
public class BackItemServiceImpl implements BackItemService{

      
	@Resource
	private BackItemDao backItemDao;
	
	
	public List<BackItem> getBack(BackItem backItem) {
		
		
		return  backItemDao.getBack(backItem);
	}

	@Override
	public void deleteById(Integer id) {
		
		 backItemDao.deleteByid(id);
		
		
	}
	

	@Override
	public void addBackItem(BackItem backitem) {
		
		backItemDao.addBackItem(backitem);
	}



	@Override
	public boolean checkExist(BackItem backitem) {
		
		List<BackItem>  list =backItemDao.checkExist(backitem);
		
		boolean flag = false;
		System.out.println("查到相同产品的集合长度："+ list.size());
		
		if(list.size()>0) {
			
			flag =true;
		}
		
		return flag;	
		
	}

	@Override
	public BackItem getOneById(Integer id) {
		
		return backItemDao.getOneById(id);
	}

	@Override
	public void updateBackItemImage(BackItem backItem) {
		
		backItemDao.updateBackItemImage(backItem);
	}
	
	

	@Override
	public void changeBackStatus(BackItem backItem) {

		backItemDao.changeBackStatus(backItem);
		
	}

	@Override
	public void deleteByIds(Integer[] ids) {
		backItemDao.deleteByids(ids);
		
	}

	@Override
	public void updateBackItem(BackItem backItem) {
		backItemDao.updateBackItem(backItem);
		
	}


}
